/**
 * 
 */
package com.sicong.myproject.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;

/**
 * 
 * @author sicongz
 *
 */
public class Header extends Composite
{
    public Header()
    {
        Label user = new Label("Sicong Zhao");
        
        Label weibo = getLabel("Weibo");
        Label slash = getLabel("|");
        Label google = getLabel("Google+");
        
        HorizontalPanel social = new HorizontalPanel();
        social.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        social.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        social.add(weibo);
        social.add(slash);
        social.add(google);
        
        HorizontalPanel header = new HorizontalPanel();
        header.setWidth("1000px");
        header.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        header.add(user);
        header.add(social);
        header.setCellHorizontalAlignment(social, HasHorizontalAlignment.ALIGN_RIGHT);
        
        SimplePanel wrapper = new SimplePanel();
        wrapper.setSize("1000px", "44px");
        wrapper.getElement().setId("headerWrapper");
        wrapper.add(header);
        
        initWidget(wrapper);
    }
    
    private Label getLabel(String text)
    {
        Label label = new Label(text);
        label.setStyleName("headerText");
        
        return label;
    }
}
